const express = require('express');
const app = express();
const cors = require('cors');
//const expressJWT = require('express-jwt')
//const config = require('./config')

// 引入路由模块
const wsRouter = require('./router/index');
app.use(cors())
app.use(express.json())
app.use(express.urlencoded({extended: false}))
//app.use(expressJWT({ secret: config.jwtSecretKey,algorithms: ['HS256'] }).unless({ path: [/^\/login\//,/^\/register\//]}))
// 挂载路由
app.use(wsRouter);

// 启动服务器
app.listen(5174, () => {
    console.log(`服务器已启动，监听端口5174`);
});